package com.yxinsur.imc.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yxinsur.imc.business.domain.ImcTeam;
import com.yxinsur.imc.business.fact.BrokerInfoTeam;
import com.yxinsur.imc.business.form.TeamForm;
import com.yxinsur.imc.business.vo.TeamVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * 营销区-团队Mapper接口
 *
 * @author imc
 * @date 2021-03-23
 */
@Mapper
public interface ImcTeamMapper extends BaseMapper<ImcTeam>
{
    /**
     * 查询营销区-团队
     *
     * @param id 营销区-团队ID
     * @return 营销区-团队
     */
    public ImcTeam selectImcTeamById(Long id);

    /**
     * 查询营销区-团队列表
     *
     * @param imcTeam 营销区-团队
     * @return 营销区-团队集合
     */
    public List<TeamVo> selectImcTeamList(TeamForm imcTeam);

    /**
     * 新增营销区-团队
     *
     * @param imcTeam 营销区-团队
     * @return 结果
     */
    public int insertImcTeam(ImcTeam imcTeam);

    /**
     * 修改营销区-团队
     *
     * @param imcTeam 营销区-团队
     * @return 结果
     */
    public int updateImcTeam(ImcTeam imcTeam);

    /**
     * 删除营销区-团队
     *
     * @param id 营销区-团队ID
     * @return 结果
     */
    public int deleteImcTeamById(String id);

    /**
     * 批量删除营销区-团队
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteImcTeamByIds(String[] ids);

    List<TeamVo> selectImcTeamByParentId(Long parentId);

    List<BrokerInfoTeam> selectTeamUpList(String[] ids);

    List<ImcTeam> selectImcTeamChild(String ancestors);

    /**
     * 根据orgid 获得team集合
     * @param orgIds
     * @return
     */
    List<ImcTeam> selectImcTeamByOrgId(List<Long> list);

    /**
     * 根据orgids 获得team集合
     * @param list
     * @return
     */
    List<ImcTeam> selectImcTeamByOrgIds(List<Long> list);

    /**
     * 根据名称获得团队信息
     * @param teamName
     * @return
     */
    ImcTeam selectByTeamName(@Param("teamName") String teamName, @Param("tenantId") Long tenantId);
}
